package com.szit.util;

/**
 * CodeMsg.class
 *
 * @author wyler
 * @date 2020/04/20
 */
public class CodeMsg {
    private int retCode;
    private String message;
    /**
     * 按照模块定义CodeMsg
     * 通用异常
     */
    public static CodeMsg SUCCESS = new CodeMsg(200,"success");
    public static CodeMsg SERVER_EXCEPTION = new CodeMsg(500,"服务端异常");
    public static CodeMsg PARAMETER_ISNULL = new CodeMsg(403,"输入参数为空");
    /**
     * 业务异常
     */
    public static CodeMsg USER_NOT_EXSIST = new CodeMsg(403,"用户不存在");
    public static CodeMsg USER_IS_EXSIST = new CodeMsg(403,"用户已存在");
    public static CodeMsg USER_PASSWORD_EXSIST = new CodeMsg(403,"用户密码错误");
    public static CodeMsg ONLINE_USER_OVER = new CodeMsg(403,"在线用户数超出允许登录的最大用户限制。");
    public static CodeMsg SESSION_NOT_EXSIST =  new CodeMsg(403,"用户未登录或令牌失效");
    public static CodeMsg NOT_FIND_DATA = new CodeMsg(404,"查找不到对应数据");
    public static CodeMsg NO_PERMISSIONS = new CodeMsg(403,"权限不足");
    public static CodeMsg UNBIND_ROLE_USER = new CodeMsg(403,"请解绑角色用户");

    private CodeMsg(int retCode, String message) {
        this.retCode = retCode;
        this.message = message;
    }
    public int getRetCode() {
        return retCode;
    }
    public String getMessage() {
        return message;
    }
    public void setMessage(String message) {
        this.message = message;
    }
}
